#include "ohos_video_render_adapter.h"

namespace ohoswebrtc {

OHOSVideoRenderAdapter::OHOSVideoRenderAdapter(
    rtc::scoped_refptr<OHOSVideoRenderInterface> renderer)
    : renderer_(renderer) {
  RTC_LOG(LS_INFO) << __FUNCTION__ << ": Ctor";
}

OHOSVideoRenderAdapter::~OHOSVideoRenderAdapter() {
  RTC_LOG(LS_INFO) << __FUNCTION__ << ": Dtor";
}

// VideoSinkInterface implementation
void OHOSVideoRenderAdapter::OnFrame(const webrtc::VideoFrame& video_frame) {
  if (renderer_) {
    renderer_->OnFrame(video_frame);
  }
}

}  // namespace ohoswebrtc
